<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:with="title='管理中心',active='home'">
<header th:replace="back/header::headerFragment(${title},${active})"></header>

<!--    引入echarts-->
<script th:src="@{/assets/js/echarts.js}"></script>

<style>
    /*#main4 {*/
    /*    float: left;*/
    /*}*/
</style>

<body class="fixed-left">
<div id="wrapper">
    <div th:replace="back/header::header-body"></div>
    <div class="content-page">
        <div class="content">
            <div class="container">
                <div class="row">
                    <div class="col-sm-12">
                        <h4 class="page-title">仪表盘</h4>
                    </div>


                    <div class="row">
                        <div class="col-sm-6 col-lg-3">
                            <div class="mini-stat clearfix bx-shadow bg-info">
                                <span class="mini-stat-icon"><i class="fa fa-quote-right" aria-hidden="true"></i></span>
                                <div class="mini-stat-info text-right">
                                    发表了<span class="counter" th:text="${articleCount}"></span>篇文章
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6 col-lg-3">
                            <div class="mini-stat clearfix bg-purple bx-shadow">
                                <span class="mini-stat-icon"><i class="fa fa-comments-o" aria-hidden="true"></i></span>
                                <div class="mini-stat-info text-right">
                                    推荐了<span class="counter" th:text="${recommendCount}"></span>篇文章
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6 col-lg-3">
                            <div class="mini-stat clearfix bg-pink bx-shadow">
                                <span class="mini-stat-icon"><i class="fa fa-file-photo-o" aria-hidden="true"></i></span>
                                <div class="mini-stat-info text-right">
                                    上传了<span class="counter" th:text="${imgcount}"></span>个附件
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row">

                        <div id="main4" style="width: 760px;height: 300px;"></div>

                    </div>






                </div>
                <div th:replace="back/footer :: footer-content"></div>
            </div>
        </div>
    </div>
</div>
<div th:replace="back/footer :: footer"></div>
</body>

<script th:inline="javascript">
    //4.
    var myChart4 = echarts.init(document.getElementById('main4'));
    myChart4.setOption({
        title: {
            text: '近7天的访客量'
        },
        toolbox: { //可视化的工具箱
            show: true,
            feature: {
                dataView: { //数据视图
                    show: true
                },
                restore: { //重置
                    show: true
                },
                dataZoom: { //数据缩放视图
                    show: true
                },
                saveAsImage: {//保存图片
                    show: true
                },
                magicType: {//动态类型切换
                    type: ['bar', 'line']
                }
            }
        },
        tooltip: {
            // trigger: 'axis',
            // formatter: '{c}个'
            trigger: 'item'
        },
        xAxis: {
            type: 'category',
            data: [
                [[${days.get(0)}]], [[${days.get(1)}]],
                [[${days.get(2)}]], [[${days.get(3)}]],
                [[${days.get(4)}]], [[${days.get(5)}]],
                [[${days.get(6)}]]
            ]
        },
        yAxis: {
            type: 'value'
        },
        series: [{
            data: [
                [[${counts.get(0)}]], [[${counts.get(1)}]],
                [[${counts.get(2)}]], [[${counts.get(3)}]],
                [[${counts.get(4)}]], [[${counts.get(5)}]],
                [[${counts.get(6)}]]
            ],
            type: 'line'
        }]
    });
</script>

</html>